package com.aiit.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_user")
public class User {



    @ApiModelProperty(value = "主键id")
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "真实姓名")
    private String name;
    @ApiModelProperty(value = "登录名")
    private String username;
    @ApiModelProperty(value = "登录密码")
    private String password;
    @TableField(exist = false)
    private String password2;
    @ApiModelProperty(value = "salt")
    private String salt;
    @ApiModelProperty(value = "部门ID")
    private Integer departmentId;
//    private String perms;
//    private int roles;
    //    @ApiModelProperty(value = "权限")
//    private Collection<String> perms;
//    @ApiModelProperty(value = "身份")
//    private Collection<String> roles;
    //字段添加填充内容
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @ApiModelProperty(value = "入职时间")
    @TableField(fill = FieldFill.INSERT)
    private Date entryTime;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @ApiModelProperty(value = "离职/升职时间")
    @TableField(fill = FieldFill.UPDATE)
    private Date departureTime;
    //逻辑删除
    @ApiModelProperty(value = "逻辑删除")
    @TableField(value = "deleted")
    @TableLogic
    private Integer deleted;

}
